Lazy List Comprehension in Logic Programming
نویسنده
چکیده
The pure prolog evaluation of a goal yields a list of answers, but the tools provided for manipulating these structures are very poor. We discuss augmenting pure prolog with a list comprehension construct that offers the possibility of referring to the finite or infinite list of answers produced. Thus meta-predicates can be defined. A substructural calculus is used to give an axiomatic semantics to the extended language. Soundness and completeness of the intended evaluation with respect to this semantics is proved.
منابع مشابه
Logic Programming with Monads and Comprehensions
We give a logical reconstruction of all-solution predicates in terms of list comprehensions in Prolog's and we describe a variety of logic programming constructs in terms of monads and monad morphisms. Novel monad structures are described for lazy function lists, clause unfoldings and a monad morphism based embedding of Prolog in Prolog is given.
متن کاملImproving List Comprehension Database Queries
The task of increasing the eeciency of database queries has recieved considerable attention. In this paper we describe the improvement of queries expressed as list comprehensions in a lazy functional language. The database literature identiies four algebraic and two implementation-based improvement strategies. For each strategy we show an equivalent improvement for queries expressed as list com...
متن کاملEager Comprehensions in Scheme The design of SRFI 42
This article is about a certain style of programming iterative programs. It is based on a concept we have named “eager comprehension,” which is a convenient and efficient alternative to tail recursion, do-loops, and lazy list comprehensions (aka “ZF expressions”). Eager comprehensions are syntactic forms that encapsulate the details of an accumulation process (counting elements, creating a list...
متن کاملImproving Functional Logic Programs by Difference-Lists
Modern multi-paradigm declarative languages integrate features from functional, logic, and concurrent programming. In this work, we consider the adaptation of the logic programming transformation based on the introduction of diierence-lists to an integrated setting. Unfortunately, the use of diierence-lists is impractical due to the absence of non-strict equality in lazy (call-by-name) language...
متن کاملProgram Specialization Based on Dynamic Slicing
Within the imperative programming paradigm, program slicing has been widely used as a basis to solve many software engineering problems, like program understanding, debugging, testing, differencing, specialization, and merging. In this work, we present a lightweight approach to program slicing in lazy functional logic languages and discuss its potential applications in the context of pervasive ...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
- J. Log. Comput.
دوره 12 شماره
صفحات -
تاریخ انتشار 2002